<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <a th:id="dafd">as</a>

    <script th:inline="javascript">
        [[${id}]]
        /*[[${name}]]*/
        var obj = JSON.parse('[[${obj}]]');
        console.log(obj.userName);
        alert([[${obj.userName}]])
    </script>
</body>
</html>